/**
 * Home首页
 * 
 * @author Gill Gong
 */

import React from 'react'
import { View, Text, Button, Image, Alert } from 'react-native'
import ModelFactory from '~/models/factory'
import config from '~/config'
import Icon from "~/common/font-set/index"

let i18nAjaxInstance = ModelFactory.create({
  url: `${config.gateway}/i18n/i18nResource/queryI18nResourceListByGroup`,
  method: 'Post'
})

class Home extends React.Component {
  static navigationOptions = ({ navigation }) => {
    
    return {
      title: 'Home',
      headerRight: ()=>{
        return (
          <Icon style={{ paddingRight: 10, color: "#fff", fontWeight: "bold" }} name="account-fill" size={30} 
            onPress = { ()=>navigation.push('AccountSetting') }
          />
        )
      }
    }
  }

  render() {

    return (
      <View style={{ textAlign:"center" }}>
        <Text style={{ 
          fontSize: 50, 
          color: "#333", 
          textAlign: "center", 
          paddingTop: 15, 
          paddingBottom: 15,
          borderBottomWidth: 1,
          borderBottomColor: '#333'
        }}>
          Jw ReactNative
        </Text>
        <Image 
        style={{ marginLeft: "auto", marginRight: "auto", marginBottom: 10, height: 300 }}
        source={require('../assets/imgs/hot-rewer.jpg')} />
        <View style={{ padding: 20 }}>
          <Button
            title="Jump to List"
            onPress={ () => this.props.navigation.push('List') }
          />
        </View>
      </View>
    )
  }

}

export default Home
